import App from './App'
import store from './store'

import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'


//全局引入统一外框组件
import appLayout from './components/app-layout.vue';
import bottomBtn from './components/bottom-btn.vue';
import printBen from './components/PrintBtn.vue';

//全局引入加解密方法
import decrypt from './core/sm2_endecrypt.js';

//前端平台信息
import platform from './core/platform.js';

//网络请求封装
import request from './core/request.js';

//缓存封装
import storage from './core/storage.js';

//网络请求封装
import Api from './core/appOnLaunch.js';


//钉钉连调工具
// import { mgop } from '@aligov/jssdk-mgop';


//工具类封装
import utils from './core/utils.js';


import user from './core/user.js';
//路由首位
import {
	router,
	RouterMount
} from './router/index.js' //路径换成自己的

Vue.use(router)
// 全局TuniaoUI
import TuniaoUI from 'tuniao-ui'


import siteinfo from './core/siteInfo.js';


// 接下来即可照常使用 `console` 等方法

import jwx from './core/jweixin.js';

// #ifdef H5
//封装专有钉钉
// import dd from 'gdt-jsapi';
// import jdd from './core/jdd.js';
//H5调试工具
// import VConsole from 'vconsole';
// #endif
import bar from "@/components/bar";
Vue.component('app-layout', appLayout);
Vue.component('bottom-btn', bottomBtn);
Vue.component('print-btn', printBen);

Vue.component('bar', bar);


Vue.use(TuniaoUI)

import uView from "uview-ui";
Vue.use(uView);


Vue.use({
	install(Vue, options) {
		Vue.prototype.$appVersion = '1.0.0';
		Vue.prototype.$decrypt = decrypt;
		Vue.prototype.$api = Api; // 接口 路径
		Vue.prototype.$request = request;
		Vue.prototype.$storage = storage;
		Vue.prototype.$user = user;
		Vue.prototype.$utils = utils;
		Vue.prototype.$siteinfo = siteinfo;
		Vue.prototype.$jwx = jwx;
		// #ifdef H5

		//封装专有钉钉
		// Vue.prototype.$jdd = jdd;
		// Vue.prototype.$dd = dd;

		//H5调试工具
		// Vue.prototype.$vconsole =  new VConsole();
		// #endif
	},
});

// 引入TuniaoUI提供的vuex简写方法
import vuexStore from './core/store_min.js';
Vue.mixin(vuexStore)

// 引入TuniaoUI对小程序分享的mixin封装
let mpShare = require('tuniao-ui/libs/mixin/mpShare.js')
Vue.mixin(mpShare)


const app = new Vue({
	store,
	...App
})
//v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式
// #ifdef H5
RouterMount(app, router, '#app')
// #endif

// #ifndef H5
app.$mount(); //为了兼容小程序及app端必须这样写才有效果
// #endif